A big part of the ounce-of-prevention mode that I
talked about at the top of the chapter is the unwavering belief that
someday something will go wrong with your computer. That might sound unduly pessimistic, but hey this is a PC we’re talking about here, and it’s never a question of if the thing will go belly up one day, but rather when that day will come.
With
that gloomy mindset, the only sensible thing to do is prepare for that
dire day so that you’re ready to get your system back on its feet. So
part of your Windows 7 maintenance chores should be getting a few
things ready that will serve you well on the day your PC decides to go
haywire on you. Besides performing a system image backup (which I
describe a bit later), you should be setting system restore points and
creating a system recovery disc. The next two sections cover these last
two techniques.
Setting System Restore Points
One
of the biggest causes of Windows instability in the past was the
tendency of some newly installed programs simply to not get along with
Windows. The problem could be an executable file that didn’t mesh with
the Windows system or a Registry change that caused havoc on other
programs or on Windows. Similarly, hardware installs often caused
problems by adding faulty device drivers to the system or by corrupting
the Registry.
To
help guard against software or hardware installations that bring down
the system, Windows 7 offers the System Restore feature. Its job is
straightforward, yet clever: to take periodic snapshots—called restore points or protection points—of
your system, each of which includes the currently installed program
files, Registry settings, and other crucial system data. The idea is
that if a program or device installation causes problems on your
system, you use System Restore to revert your system to the most recent
restore point before the installation.
System Restore automatically creates restore points under the following conditions:
Every 24 hours— This is called a system checkpoint,
and it’s set once a day as long as your computer is running. If your
computer isn’t running, the system checkpoint is created the next time
you start your computer, assuming that it has been at least 24 hours
since that previous system checkpoint was set.
Note
The system checkpoint interval is governed by a task in the Task Scheduler (select Start, type scheduler,
and then click Task Scheduler in the search results). Open the Task
Scheduler Library, Microsoft, Windows branch, and then click the
SystemRestore task. To make changes to the task, click Properties in
the Action pane to display the SR Properties dialog box. To change the
schedule that Windows 7 uses to create system checkpoints, display the
Triggers tab, click the trigger you want to change (Daily or At
Startup), and then click Edit.
Before installing certain applications—
Some newer applications (notably Office 2000 and later) are aware of
System Restore and will ask it to create a restore point prior to
installation.
Before installing a Windows Update patch—
System Restore creates a restore point before you install a patch
either by hand via the Windows Update site or via the Automatic Updates
feature.
Before installing an unsigned device driver—
Windows 7 warns you about installing unsigned drivers. If you choose to
go ahead, the system creates a restore point before installing the
driver.
Before restoring backed-up files—
When you use the Windows 7 Backup program to restore one or more
backed-up files, System Restore creates a restore point just in case
the restore causes problems with system files.
Before reverting to a previous configuration using System Restore—
Sometimes reverting to an earlier configuration doesn’t fix the current
problem or it creates its own set of problems. In these cases, System
Restore creates a restore point before reverting so that you can undo
the restoration.
It’s also possible to create a restore point manually using the System Protection feature. Here are the steps to follow:
1. | Select Start, type restore point,
and then click Create a Restore Point in the search results. This opens
the System Properties dialog box with the System Protection tab
displayed, as shown in Figure 1.
|
2. | By
default, Windows 7 creates automatic restore points for just the system
drive. If you have other drives on your system and you want to create
automatic restore points for them, as well, click the drive in the
Protection Settings list, click Configure, activate the Restore System
Settings and Previous Versions of Files option, and then click OK.
|
3. | Click Create to display the Create a Restore Point dialog box.
|
4. | Type
a description for the new restore point and then click Create. System
Restore creates the restore point and displays a dialog box to let you
know.
|
5. | Click Close to return to the System Properties dialog box.
|
6. | Click OK.
|
Tip
To
change how much disk space System Restore uses to store checkpoints on
a drive, click the drive in the Protection Settings list, click
Configure, use the Max Usage slider to set the amount of disk space you
want. If the hard disk is getting low on free space, you can also click
the Delete button to remove all the restore points from the hard disk.
If
you find yourself setting restore points frequently, it can be a pain
to go through those steps every time. A much faster way to go about
this is to use a script that creates a restore point instantly. Listing 1 shows just such a script.
Listing 1. A Script That Creates a Restore Point
Option Explicit Dim strComputer, objWMI, objSR, strDesc, intResult ' ' Get the SystemRestore object ' strComputer = "." Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\default") Set objSR = objWMI.Get("SystemRestore") ' ' Ask for a restore point description ' strDesc = InputBox ("Enter a description for the restore point:", , _ "Instant Restore Point") ' ' Create the restore point ' intResult = objSR.CreateRestorePoint (strDesc, 0, 100) ' ' Check the result ' If intResult = 0 Then ' ' Success! ' WScript.Echo "Instant restore point '" & strDesc & "' created!" Else ' ' Failure! ' WScript.Echo "Instant restore point '" & strDesc & "' failed!" & _ vbCrLf & "Error code: " & intResult End If ' ' Release the objects ' Set objWMI = Nothing Set objSR = Nothing
|
This script uses Windows Management Instrumentation (WMI) to return the SystemRestore
class. The script displays a dialog box so that you can type a
description of the restore point, and it then uses that description
when it runs the CreateRestorePoint
method. The script checks the result and displays a dialog box letting
you know whether the restore point was created successfully.
Creating a System Repair Disc
In
Windows Vista, you could attempt to get a badly behaving machine up and
running again by booting to the Vista install disc and then accessing
the system recovery options. That was a nice feature, but only if you
could find your install disc (or if you ever had one in
the first place)! Windows 7 fixes that problem by giving you the option
of creating your own system repair disc. Here’s how you go about this:
1. | Select Start, type recovery disc,
and then click Create a System Repair Disc in the search results. The
Create a System Repair Disc dialog box appears, as shown in Figure 2.
|
2. | Insert a blank recordable CD or DVD into your burner. If the AutoPlay dialog box shows up, close it.
|
3. | If you have multiple burners, use the Drive list to select the one you want to use
|
4. | Click Create Disc. Windows 7 creates the disk (it takes a minute or two), and then displays a particularly unhelpful dialog box.
|
5. | Click Close and then click OK.
|
Eject
the disc, label it, and then put it someplace where you’ll be able to
find it later on.